package org.huang.sample03.demo02;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @描述: 简单的Filter
 * @作者 Mr.Huang
 * @创建时间 2017-08-07
 * @版本: 1.0
 */
@WebFilter(urlPatterns = "/servlet02/*",filterName = "filter02")
public class MyFilter02 implements Filter {

    @Override
    public void destroy() {
        System.out.println("过滤器销毁");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
        System.out.println("执行过滤操作<<<<MyFilter02");
        chain.doFilter(request, response);
        System.out.println("执行过滤操作>>>>MyFilter02");
    }

    @Override
    public void init(FilterConfig config) throws ServletException {
        System.out.println("过滤器初始化");
    }

}